package com.example.paopao.consumer.memer.dao.persist.repository.impl;

import com.example.paopao.consumer.memer.dao.persist.mapper.IItegralsMapper;
import com.example.paopao.consumer.memer.dao.persist.repository.IItegralsRepository;
import com.example.paopao.consumer.memer.pojo.vo.IntegraRacheGetVO;
import com.example.paopao.consumer.memer.pojo.vo.IntegralVO;
import com.example.paopao.consumer.memer.pojo.vo.ResultIntegrals;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class IntegralsRepositoryImpl implements IItegralsRepository {

    @Autowired
    private IItegralsMapper iItegralsMapper;

    @Override
    public ResultIntegrals getIntegrals(Long userId) {
        ResultIntegrals integrals = iItegralsMapper.getIntegrals(userId);
        if (integrals ==null){
            return null;
        }
        return integrals;
    }

    @Override
    public List<IntegralVO> listIntegral() {
        return iItegralsMapper.listIntegral();
    }

    @Override
    public List<IntegraRacheGetVO> listIntracha(Long userId) {
        return iItegralsMapper.listIntracha(userId);
    }
}
